#include <cstdio>
#include <iostream>

using namespace std;
int n;

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("TEST.inp","rt",stdin);
		freopen("TEST.out","wt",stdout);
	#endif
	while (scanf("%d",&n)==1)
        if (n!=42)
            cout << n << endl;
        else
            return 0;
}
